package com.yangzihao.feign.clients;

import com.yangzihao.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient("userservice")
public interface UserClients {

    @GetMapping("/user/{id}")
    User findById(@PathVariable("id") Long id);

//    必须添加@RequestParam 用于增加参数映射 不然会报错405
    @GetMapping("/user/updateById")
    Integer updateById(@RequestParam("id") Long id);
}
